package com.tengju.user.domain.model.user;

import lombok.AllArgsConstructor;

/**
 * 在职状态，1在职，0离职
 *
 * @Author: 李大仙
 * @Date: 2021/4/23 10:41 上午
 */
@AllArgsConstructor
public enum JobStatus {

    /**
     * 离职
     */
    LEAVING(0, "离职"),
    /**
     * 在职
     */
    SERVING(1, "在职"),
    ;
    private Integer val;
    private String desc;

    public Integer getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    public static JobStatus fromVal(Integer val) {
        for (JobStatus type : values()) {
            if (type.val.equals(val)) {
                return type;
            }
        }
        return null;
    }
}
